
import http from "@/utils/ajax/http"
import {extend} from "@/utils/extend"

const api = {
    code:{
        OK:0    },
    user:{
        login:'authLogin.do?ac=login',
        tokenLogin:'tokenLogin.do',
        logout: 'logout.do'
    },
    checkUpdate:'sh.do',
    editorPassword :'editPassword',
    checkField:'checkno.do',

        payment:'payment.do',
    
    collect:'collect.do',
    shoucangjilu: {
        listusername:"shoucangjilu_list2.do",
        delete:'shoucangjilu_delete'
    },
    captch(){
        var url = "captcha.do?rd="+Math.floor(Math.random()*100000);
        return new Promise((resolve, reject) => {
            http.get( url ).then(res=>{
                var url = res.data;
                resolve(url);
            },reject);
        });
    },
    search:{
        select:'selectUpdateSearch.do',
        table:'tableAjax.do?a=table',
        selectView:'selectView.do',
        all:'selectAll.do'
    },
    attachment:{
        uploadUrl:'upload_re.do',
        upload (file) {
            return new Promise((resolve, reject) => {
                var formdata = new FormData();
                formdata.append("fujian" , file , file.name || 'tmp.png');
                http.post(api.attachment.uploadUrl , formdata)
                    .then(res=>{
                        if(res.code == api.code.OK)
                        {
                            resolve(res.data);
                        }else{
                            reject(res.msg);
                        }
                    }).catch(err=>{
                        reject(err.message);
                    });
            });
        },
    },
        admins:{
                list:"admins_list.do",
                insert:"adminsinsert.do",
                update:"adminsupdate.do",
                delete:"admins_delete.do",
                detail:"admins_detail.do",
                create:"admins_add.do",
                edit:"admins_updt.do",
            },
        yonghu:{
                list:"yonghu_list.do",
                insert:"yonghuinsert.do",
                update:"yonghuupdate.do",
                delete:"yonghu_delete.do",
                detail:"yonghu_detail.do",
                create:"yonghu_add.do",
                edit:"yonghu_updt.do",
            },
        zixunfenlei:{
                list:"zixunfenlei_list.do",
                insert:"zixunfenleiinsert.do",
                update:"zixunfenleiupdate.do",
                delete:"zixunfenlei_delete.do",
                detail:"zixunfenlei_detail.do",
                create:"zixunfenlei_add.do",
                edit:"zixunfenlei_updt.do",
            },
        chongwuzixun:{
                list:"chongwuzixun_list.do",
                insert:"chongwuzixuninsert.do",
                update:"chongwuzixunupdate.do",
                delete:"chongwuzixun_delete.do",
                detail:"chongwuzixun_detail.do",
                create:"chongwuzixun_add.do",
                edit:"chongwuzixun_updt.do",
                listtianjiaren:"chongwuzixun_list_tianjiaren.do",
                weblist:"chongwuzixunlist.do",
                webdetail:"chongwuzixundetail.do",
            },
        youqinglianjie:{
                list:"youqinglianjie_list.do",
                insert:"youqinglianjieinsert.do",
                update:"youqinglianjieupdate.do",
                delete:"youqinglianjie_delete.do",
                detail:"youqinglianjie_detail.do",
                create:"youqinglianjie_add.do",
                edit:"youqinglianjie_updt.do",
            },
        liuyanfankui:{
                list:"liuyanfankui_list.do",
                insert:"liuyanfankuiinsert.do",
                update:"liuyanfankuiupdate.do",
                delete:"liuyanfankui_delete.do",
                detail:"liuyanfankui_detail.do",
                create:"liuyanfankui_add.do",
                edit:"liuyanfankui_updt.do",
                listliuyanren:"liuyanfankui_list_liuyanren.do",
            },
        lunbotu:{
                list:"lunbotu_list.do",
                insert:"lunbotuinsert.do",
                update:"lunbotuupdate.do",
                delete:"lunbotu_delete.do",
                detail:"lunbotu_detail.do",
                create:"lunbotu_add.do",
                edit:"lunbotu_updt.do",
            },
        shangpinfenlei:{
                list:"shangpinfenlei_list.do",
                insert:"shangpinfenleiinsert.do",
                update:"shangpinfenleiupdate.do",
                delete:"shangpinfenlei_delete.do",
                detail:"shangpinfenlei_detail.do",
                create:"shangpinfenlei_add.do",
                edit:"shangpinfenlei_updt.do",
            },
        shangpinxinxi:{
                list:"shangpinxinxi_list.do",
                insert:"shangpinxinxiinsert.do",
                update:"shangpinxinxiupdate.do",
                delete:"shangpinxinxi_delete.do",
                detail:"shangpinxinxi_detail.do",
                create:"shangpinxinxi_add.do",
                edit:"shangpinxinxi_updt.do",
                weblist:"shangpinxinxilist.do",
                webdetail:"shangpinxinxidetail.do",
            },
        gouwuche:{
                list:"gouwuche_list.do",
                insert:"gouwucheinsert.do",
                update:"gouwucheupdate.do",
                delete:"gouwuche_delete.do",
                detail:"gouwuche_detail.do",
                create:"gouwuche_add.do",
                edit:"gouwuche_updt.do",
                listgoumairen:"gouwuche_list_goumairen.do",
            },
        dingdanxinxi:{
                list:"dingdanxinxi_list.do",
                insert:"dingdanxinxiinsert.do",
                update:"dingdanxinxiupdate.do",
                delete:"dingdanxinxi_delete.do",
                detail:"dingdanxinxi_detail.do",
                create:"dingdanxinxi_add.do",
                edit:"dingdanxinxi_updt.do",
                listxiadanren:"dingdanxinxi_list_xiadanren.do",
            },
        guanyu:{
                list:"guanyu_list.do",
                insert:"guanyuinsert.do",
                update:"guanyuupdate.do",
                delete:"guanyu_delete.do",
                detail:"guanyu_detail.do",
                create:"guanyu_add.do",
                edit:"guanyu_updt.do",
                webdetail:"guanyudetail.do",
            },
        fenxiangqushi:{
                list:"fenxiangqushi_list.do",
                insert:"fenxiangqushiinsert.do",
                update:"fenxiangqushiupdate.do",
                delete:"fenxiangqushi_delete.do",
                detail:"fenxiangqushi_detail.do",
                create:"fenxiangqushi_add.do",
                edit:"fenxiangqushi_updt.do",
                listfenxiangren:"fenxiangqushi_list_fenxiangren.do",
                weblist:"fenxiangqushilist.do",
                webdetail:"fenxiangqushidetail.do",
            },
        yiliaofuwu:{
                list:"yiliaofuwu_list.do",
                insert:"yiliaofuwuinsert.do",
                update:"yiliaofuwuupdate.do",
                delete:"yiliaofuwu_delete.do",
                detail:"yiliaofuwu_detail.do",
                create:"yiliaofuwu_add.do",
                edit:"yiliaofuwu_updt.do",
                weblist:"yiliaofuwulist.do",
                webdetail:"yiliaofuwudetail.do",
            },
        fuwuyuyue:{
                list:"fuwuyuyue_list.do",
                insert:"fuwuyuyueinsert.do",
                update:"fuwuyuyueupdate.do",
                delete:"fuwuyuyue_delete.do",
                detail:"fuwuyuyue_detail.do",
                create:"fuwuyuyue_add.do",
                edit:"fuwuyuyue_updt.do",
                listyuyueren:"fuwuyuyue_list_yuyueren.do",
            },
        yuyuechuli:{
                list:"yuyuechuli_list.do",
                insert:"yuyuechuliinsert.do",
                update:"yuyuechuliupdate.do",
                delete:"yuyuechuli_delete.do",
                detail:"yuyuechuli_detail.do",
                create:"yuyuechuli_add.do",
                edit:"yuyuechuli_updt.do",
                listyuyueren:"yuyuechuli_list_yuyueren.do",
            },
        pinglun:{
                list:"pinglun_list.do",
                insert:"pingluninsert.do",
                update:"pinglunupdate.do",
                delete:"pinglun_delete.do",
                detail:"pinglun_detail.do",
                create:"pinglun_add.do",
                edit:"pinglun_updt.do",
                listyuyueren:"pinglun_list_yuyueren.do",
            },
        huifupinglun:{
                list:"huifupinglun_list.do",
                insert:"huifupingluninsert.do",
                update:"huifupinglunupdate.do",
                delete:"huifupinglun_delete.do",
                detail:"huifupinglun_detail.do",
                create:"huifupinglun_add.do",
                edit:"huifupinglun_updt.do",
                listyuyueren:"huifupinglun_list_yuyueren.do",
            },
        chongzhi:{
                list:"chongzhi_list.do",
                insert:"chongzhiinsert.do",
                update:"chongzhiupdate.do",
                delete:"chongzhi_delete.do",
                detail:"chongzhi_detail.do",
                create:"chongzhi_add.do",
                edit:"chongzhi_updt.do",
                listchongzhiren:"chongzhi_list_chongzhiren.do",
            },
    }

export default api
